package dq.study.designmodel.proxy.dynamic;

import dq.study.designmodel.proxy.Moving;
import dq.study.designmodel.proxy.Tank;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

/**
 * @author dongqun
 * @Description:
 * @date 2019/3/31 22:37
 */
public class Client {
    public static void main(String[] args) throws NoSuchMethodException, IOException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
        Tank tank = new Tank();
        InvokeHandler invokeHandler = new LogInvokeHandler(tank);
        Moving moving = (Moving) Proxy.newProxyInstance(Moving.class,invokeHandler);
        moving.move();
    }
}
